{% extends 'photoapp/base.html' %}
{% block title %}
    相册管理系统
{% endblock %}

{% block body %}
    <table>
        <thead>
            <tr>
                <th>标题</th>
                <th>缩略图</th>
                <th>上传时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for photo in photos %}
                <tr>
                    <td>{{ photo.title }}</td>
                    <td><img src="/{{ photo.filepath_s }}" alt=""></td>
                    <td>{{ photo.pub_time|date:"y-m-d H:i:s" }}</td>
                    <td>
                        <a href="{% url 'edit_photo' photo_id=photo.id%}">编辑</a>
                        <a href="{% url 'delete_photo' photo_id=photo.id %}">删除</a>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    <ul>
        {% for page in page_num %}
            <li style="list-style: none; float: left; margin:5px;"><a href="{% url 'index' page_index=page%}">{{ page }}</a></li>
        {% endfor %}
        
    </ul>
{% endblock %}